<cfscript>
	workshopGateway = new assets.calgrants.com.gateway.WorkshopGateway();
	workshops = workshopGateway.query(Program_Year = '2013-2014', Deleted = 0, Approved = 1);
</cfscript>

<cfquery name="GetWorkshopsGrouped" dbtype="query">
	select * from workshops
	order by Region_ID,Organization_ID, Student_Count, Student_Count_Web, Student_Count_PB
</cfquery>
Organization_Type,Region_ID,Organization,Student_Count,Student_Count_Web,Student_Count_PB,Organizer,Email,Site_Eligible<br>
<cfoutput query="GetWorkshopsGrouped" group="Organization">
<cfset eligibleWorkshopCount = 0 />
<cfset ineligibleWorkshopCount = 0 />
<cfset orgElig = "" />

<cfoutput>
<cfif Student_Count gte 25 and Student_Count_Web gt 0>
	<cfset eligibleWorkshopCount = eligibleWorkshopCount + 1 />
<cfelse>
	<cfset ineligibleWorkshopCount = ineligibleWorkshopCount + 1 />
</cfif>
</cfoutput>

<cfif eligibleWorkshopCount eq 0 and ineligibleWorkshopCount gt 0>
<cfset orgElig = "Ineligible" />
<cfelseif eligibleWorkshopCount gt 0 and ineligibleWorkshopCount eq 0>
<cfset orgElig = "Eligible" />
<cfelseif eligibleWorkshopCount gt 0 and ineligibleWorkshopCount gt 0>
<cfset orgElig = "Mixed" />
</cfif>

<cfoutput>

#orgElig#,#Region_ID#,#Organization#,#Student_Count#,#Student_Count_Web#,#Student_Count_PB#,#Organizer_First_Name# #Organizer_Last_Name#,#Organizer_Email#,<cfif Student_Count gte 25 and Student_Count_Web gt 0>Eligible<cfset eligibleWorkshopCount = eligibleWorkshopCount + 1 /><cfelse>Ineligible<cfset ineligibleWorkshopCount = ineligibleWorkshopCount + 1 /></cfif><br>
</cfoutput>

</cfoutput>